import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;

public class T {


    public static void main(String[] args) {
        Queue<Integer> queue=new LinkedList<>();

        ArrayList<Integer> arrayList=new ArrayList<>();
        arrayList.add(11);
        arrayList.add(12);
        arrayList.add(13);
        arrayList.add(14);



        queue.add(1);
        queue.add(2);
        queue.add(3);
        queue.add(4);

        queue.addAll(arrayList);


        System.out.println(queue.toString());

    }
    public static void main1(String[] args) {
        Stack<Integer> stack=new Stack<>();
        Stack<Integer> stack2=new Stack<>();

        ArrayList<Integer> arrayList=new ArrayList<>();
       arrayList.add(11);
       arrayList.add(12);
       arrayList.add(13);
       arrayList.add(14);


        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);

        stack2.push(4);
        stack2.push(5);
        stack2.push(6);
        stack2.push(7);

        System.out.println(stack.peek());//查看栈顶的数据

        //依次进行数据出栈
        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");


        stack.addAll(arrayList);
        System.out.println();

        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");
        System.out.print(stack.pop()+" ");




    }


}

